package net.oschina.simpleplus.client;

import java.util.concurrent.atomic.AtomicInteger;

public class Packet {
	private static AtomicInteger requestId = new AtomicInteger(0);

	private int rqid; // 请求的ID
	private long did; // 全局的ID

	public Packet() {
		rqid = requestId.getAndIncrement();
	}

	public Packet(int rqid, long did) {
		super();
		this.rqid = rqid;
		this.did = did;
	}

	public int getRqid() {
		return rqid;
	}

	public void setRqid(int rqid) {
		this.rqid = rqid;
	}

	public long getDid() {
		return did;
	}

	public void setDid(long did) {
		this.did = did;
	}

	@Override
	public String toString() {
		return String.format("Packet [rqid=%s, did=%s]", rqid, did);
	}

}
